package pkg.nudroid.translator;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.File;

class Driver {
	public static void main(String[] args) throws FileNotFoundException, IOException {
		  // STATIC VARIABLES
		  final int NUMBEROFTESTFILES = 13;
		  final String[] testFileName = new String[NUMBEROFTESTFILES];
		  
		  // TEST FILE PATHS
		  String mainFolder = System.getProperty("user.dir") + "\\src\\pkg\\nudroid\\translator\\TestCases\\";
		  //String mainFolder = "pkg/nudroid/translator/TestCases/";
		  //testFileName[0] = "ntag.nudroid";
		  testFileName[0] = "1_pagelabels.nudroid";
		  testFileName[1] = "2_textBox.nudroid";
		  testFileName[2] = "3_textAndButton.nudroid";
		  testFileName[3] = "4_linkTextButton.nudroid";
		  testFileName[4] = "5_pageLinkTextButton.nudroid";
		  testFileName[5] = "6_testList.nudroid";
		  testFileName[6] = "7_testTable.nudroid";
		  testFileName[7] = "hello.nudroid";
		  testFileName[8] = "ntag.nudroid";
		  testFileName[9] = "shell.nudroid";
		  testFileName[10] = "8_testFunc.nudroid";
		  testFileName[11] = "9_varTest.nudroid";
		  testFileName[12] = "10_tagAttrTest.nudroid";
		  
		  // BEGIN CODE TO READ TEST FILE
		  for(int i=10; i < testFileName.length; i++){
			  System.out.println("#############################");
			  System.out.println("##     TESTING FILE "+(i+1));
			  System.out.println("##  "+testFileName[i]);
			  System.out.println("#############################");
			  
			  String file = mainFolder.concat(testFileName[i]);
			  FileReader f = new FileReader(file);
			  Parser parser = new Parser(f);
			  Yylex lexer = new Yylex(f, parser);
			  
			  int output;
			  do {
				  output = lexer.yylex();
			//	  System.out.println(output);
			  } while (output != 0);
		  }
	}
}

